package com.banmao.mall.mapper;

import com.banmao.mall.model.bo.admin.market.CategoryBO;
import com.banmao.mall.model.pojo.Category;
import com.banmao.mall.model.vo.admin.goods.CategoryChildrenVO;
import com.banmao.mall.model.vo.admin.market.CategoryL1VO;
import com.banmao.mall.model.vo.admin.market.CategoryL2VO;
import com.banmao.mall.model.vo.admin.market.CategoryVO;
import com.banmao.mall.model.vo.client.index.ChannelVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CategoryMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Category record);

    int insertSelective(CategoryBO record);

    Category selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Category record);

    int updateByPrimaryKey(Category record);

    List<CategoryL1VO> selectL1BaseInfo();

    List<CategoryVO> selectL1();

    List<CategoryL2VO> selectL2ByPID(Integer id);

    int updateCategoryByID(CategoryBO categoryBO);

    int updatePidByID(@Param("pid") Integer pid, @Param("id") Integer id);

    int changeDeletedByID(Integer id);

    List<ChannelVO> selectChannel();

    com.banmao.mall.model.vo.client.goods.CategoryVO selectCategoryByID(Integer id);

    List<com.banmao.mall.model.vo.client.goods.CategoryVO> selectChildrenByPID(Integer id);

    List<com.banmao.mall.model.vo.admin.goods.CategoryVO> selectValueAndLabelL1();

    List<CategoryChildrenVO> selectValueAndLabelL2(Integer id);

    //ps
    List<Category> selectCategoryByLevel(String level);
    //ps
    List<Category> selectCategoryByPID(Integer currentCategoryId);
    Integer selectCateIDL2(Integer categoryId);

    com.banmao.mall.model.vo.client.goods.CategoryVO selectCategoryByChildID(Integer pid);

    com.banmao.mall.model.vo.client.goods.CategoryVO selectCategoryByGoods(Integer categoryId);

}